<?php
require './library/db_constants.php';
require './library/planets.php';
require './library/deposits.php';
require './library/terrain.php';

$deposit = new deposits;
$planets = new planets;
$terrain = new terrain;
$planetName = $_GET['q'];



$planetInfo = $planets->planetInfo(NULL, $planetName);
$planetID = $planetInfo['id'];
$planetSize = $planetInfo['size'];

$deposit->drawDepositMap($planetID, $planetSize);
?>
<?php 

    $HTML = '<label for="coordinates">Coordinates: </label>
                    <select name="coordinates">';
    echo $HTML;
    
    for ($y = 0; $y <= $planetInfo['size']; $y++) {
        for ($x = 0; $x <= $planetInfo['size']; $x++) {
            echo '<option value="'.$x.', '.$y.'">'.$x.', '.$y.'</option>';
        }
    }
                                
    echo "</select>";
?>